class Solution:
    def findKthPositive(self, arr: List[int], k: int) -> int:
        a, r = 0, len(arr) - 1
        while a <= r:
            mid = a + (r - a) // 2
            if arr[mid] - mid - 1 >= k:
                r = mid - 1
            else:
                a = mid + 1
        return a + k